﻿@model IEnumerable<ExcellOnServices.Models.Service>

@{
    ViewBag.Title = "Services List";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}

<div class="panel panel-primary">
    <div class="panel-heading">Services List</div>
    <div class="panel-body" style="margin-bottom:35px;">
        @using (Html.BeginForm("Index", "Services", new { orderPriceAsce = ViewBag.OrderPriceAsce }, FormMethod.Post, new { @class = "form-inline" }))
        {
            <div class="pull-right">
                <div class="form-group">
                    @Html.TextBox("search", null, new { @class = "form-control", @placeholder = "Service name" })
                </div>
                <button type="submit" class="btn btn-primary">Search</button>
                <input type="reset" value="Clear" class="btn btn-default" />
            </div>
        }
    </div>
    <table class="table table-striped table-hover">
        <tr>
            <th>Image</th>
            <th>Name</th>
            <th>@Html.ActionLink("Price", "Index", new { search = ViewBag.Search, orderPriceAsce = !ViewBag.OrderPriceAsce })</th>
            <th>Create Date</th>
            <th>Modified Date</th>
            <th>Edit</th>
            @*<th>Details</th>*@
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    <img src="@item.ImageUrl" style="width:50px;" />
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Price)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CreatedDateTime)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ModifiedDateTime)
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new { id = item.Id }, new { @class = "btn btn-primary btn-sm" })
                </td>
                @*<td>
                        @Html.ActionLink("Details", "Details", new { id = item.Id }, new { @class = "btn btn-primary btn-sm" })
                    </td>*@ 
            </tr>
        }
    </table>
</div>
